<template>
  <a-page-header style="border: 1px solid rgb(235, 237, 240)" :title="title" :sub-title="subTitle" :ghost="false" class="custom-header" @back="handleBack" />
</template>
<script>
export default {
  props: {
    title: {
      type: String,
      default: '',
      require: false,
    },
    subTitle: {
      type: String,
      default: '',
      require: false,
    },
    hasBackPath: {
      type: Boolean,
      default: false,
      require: false,
    },
  },
  methods: {
    handleBack() {
      if (!this.hasBackPath) {
        this.$router.go(-1)
      } else {
        this.$emit('headerBack')
      }
    },
  },
}
</script>
<style lang="less" scoped>
.custom-header {
  margin: -12px -12px 24px;
}
</style>
